<?php

/**
 * This is the model class for table "worker_verify_request_log".
 *
 * The followings are the available columns in table 'worker_verify_request_log':
 * @property string $log_id
 * @property string $mobile
 * @property string $request_id
 * @property string $worker_id
 * @property integer $is_delete
 * @property string $create_time
 * @property string $update_time
 * @property double $price
 * @property string $real_name
 * @property string $id_card
 * @property string $avatar
 * @property string $pic_idcard
 * @property string $status
 * @property integer $type_id
 * @property string $type_name
 * @property integer $work_year
 * @property string $reason
 * @property string $created_by
 * @property string $updated_by
 */
class WorkerVerifyRequestLog extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return WorkerVerifyRequestLog the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'worker_verify_request_log';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('request_id, worker_id, real_name', 'required'),
			array('is_delete, type_id, work_year', 'numerical', 'integerOnly'=>true),
			array('price', 'numerical'),
			array('mobile, real_name, id_card, status, type_name, reason, created_by, updated_by', 'length', 'max'=>255),
			array('request_id, worker_id', 'length', 'max'=>64),
			array('create_time, update_time, avatar, pic_idcard', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('log_id, mobile, request_id, worker_id, is_delete, create_time, update_time, price, real_name, id_card, avatar, pic_idcard, status, type_id, type_name, work_year, reason, created_by, updated_by', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'log_id' => 'Log',
			'mobile' => 'Mobile',
			'request_id' => 'Request',
			'worker_id' => 'Worker',
			'is_delete' => 'Is Delete',
			'create_time' => 'Create Time',
			'update_time' => 'Update Time',
			'price' => 'Price',
			'real_name' => 'Real Name',
			'id_card' => 'Id Card',
			'avatar' => 'Avatar',
			'pic_idcard' => 'Pic Idcard',
			'status' => 'Status',
			'type_id' => 'Type',
			'type_name' => 'Type Name',
			'work_year' => 'Work Year',
			'reason' => 'Reason',
			'created_by' => 'Created By',
			'updated_by' => 'Updated By',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('log_id',$this->log_id,true);
		$criteria->compare('mobile',$this->mobile,true);
		$criteria->compare('request_id',$this->request_id,true);
		$criteria->compare('worker_id',$this->worker_id,true);
		$criteria->compare('is_delete',$this->is_delete);
		$criteria->compare('create_time',$this->create_time,true);
		$criteria->compare('update_time',$this->update_time,true);
		$criteria->compare('price',$this->price);
		$criteria->compare('real_name',$this->real_name,true);
		$criteria->compare('id_card',$this->id_card,true);
		$criteria->compare('avatar',$this->avatar,true);
		$criteria->compare('pic_idcard',$this->pic_idcard,true);
		$criteria->compare('status',$this->status,true);
		$criteria->compare('type_id',$this->type_id);
		$criteria->compare('type_name',$this->type_name,true);
		$criteria->compare('work_year',$this->work_year);
		$criteria->compare('reason',$this->reason,true);
		$criteria->compare('created_by',$this->created_by,true);
		$criteria->compare('updated_by',$this->updated_by,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}